package com.xywl.escort.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xywl.escort.R;
import com.xywl.escort.bean.MessageResp.DataBean.ListBean;

import java.util.List;

/**
 * Created by 32422 on 2018/5/10.
 */

public class MessageListAdapter extends BaseQuickAdapter<ListBean, BaseViewHolder> {
    public MessageListAdapter(int layoutResId, @Nullable List<ListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ListBean item) {
        helper.setText(R.id.text_title, item.title);
        helper.setText(R.id.text_content, item.content);
        helper.setText(R.id.text_time, item.createTime);

        ImageView imageStatus = helper.getView(R.id.image_status);
        switch (item.status) {
            case 0:
                imageStatus.setVisibility(View.VISIBLE);
                break;
            case 1:
                imageStatus.setVisibility(View.GONE);
                break;
            default:
                imageStatus.setVisibility(View.GONE);
                break;
        }
    }
}
